/**
 * Project Name:gjerp
 * File Name:JsonResult.java
 * Package Name:com.times.domain
 * Date:2015��7��3������12:38:30
 * Copyright (c) 2015, times.com All Rights Reserved.
 *
 */

package com.times.util;

import java.util.ArrayList;
import java.util.List;


/**
 * ClassName: JsonResult <br/>
 * Function: ͳһ����json��ݸ�ʽ
 *
 * @author ZZW
 * @version 2015��7��3�� 
 */
public class JsonResult {
    
    private boolean success;

    private Object code;
    
    private String msg;
    
    private List<?> data;

    
    
    /**
     * Getter method for property <tt>success</tt>.
     *
     * @return property value of success.
     */
    public boolean getSuccess() {
        return success;
    }


    
    /**
     * Setter method for property <tt>success</tt>.
     *
     * @param success value to be assigned to property success.
     */
    public void setSuccess(boolean success) {
        this.success = success;
    }


    /**
     * Getter method for property <tt>code</tt>.
     *
     * @return property value of code.
     */
    public Object getCode() {
        return code;
    }

    
    /**
     * Setter method for property <tt>code</tt>.
     *
     * @param code value to be assigned to property code.
     */
    public void setCode(Object code) {
        this.code = code;
    }

    
    /**
     * Getter method for property <tt>msg</tt>.
     *
     * @return property value of msg.
     */
    public String getMsg() {
        return msg;
    }

    
    /**
     * Setter method for property <tt>msg</tt>.
     *
     * @param msg value to be assigned to property msg.
     */
    public void setMsg(String msg) {
        this.msg = msg;
    }

    
    /**
     * Getter method for property <tt>data</tt>.
     *
     * @return property value of data.
     */
    public List<?> getData() {
        return data;
    }

    
    /**
     * Setter method for property <tt>data</tt>.
     *
     * @param data value to be assigned to property data.
     */
    public void setData(Object data)
    {
        if(data instanceof List){
            this.data = (List<?>) data;
        }else{
            List<Object> list = new ArrayList<Object>();
            list.add(data);
            this.data = list;
        }
    }
}

